package org.accp.controller;

import org.accp.dao.ApparatuDao;
import org.accp.dao.DepartmentDao;
import org.accp.pojo.Apparatu;
import org.accp.pojo.Department;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@RequestMapping("/app")
@Controller
@CrossOrigin("*")
public class AppController {
    @Autowired
    private ApparatuDao apparatuDao;

    @RequestMapping("/search")
    @ResponseBody
    public List<Apparatu> search() throws Exception {
        return apparatuDao.getAll();
    }
}